package com.hmall.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmall.user.mapper.UserMapper;
import com.hmall.user.pojo.User;
import com.hmall.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     *  通过用户id查询用户
     * @param userId 用户id
     * @return 用户
     */
    @Override
    public User getUserById(Long userId) {
        User user = userMapper.findUserById(userId);
        return user;
    }
}
